var vm = new Vue({
	el : '#rrapp',
	data : {
		hisContractpay : {},
		hisContractpayDetailList:[]
	},
	created: function() {
		var id = GetRequest(location.search)["id"];
		$.get("../datacontractpay/infoXtd/"+id+"?_" + $.now(), function(r){
            vm.hisContractpay = r.hisContractpay;
           if(vm.hisContractpay.paytime !=null){
            	vm.hisContractpay.paytime = vm.hisContractpay.paytime.substring(0,10);
            }
            vm.hisContractpayDetailList=r.hisContractpayDetailList;
			initGrid(vm.hisContractpayDetailList);
			//console.log(vm.hbApptransHead)
			//console.log(vm.hbApptransBody)
        });
	}
});

function initGrid(data) {
	$("#jqGrid").jqGrid({
		datatype : 'local',
		data: data || [],
		colModel : [ {
			label: 'id',
			name : "id",
			index : "id",
			key : true,
			hidden: true
		}, {
			label: 'hisid',
			name : "hisid",
			index : "hisid",
			align : 'center',
			hidden : true
		}, {
			label: 'contractid',
			name : "contractid",
			index : "contractid",
			align : 'center',
			hidden : true
		}, {
			label: '员工编号',
			name : "splitEmployeeWorkNo",
			index : "splitEmployeeWorkNo",
			width : '100'
		}, {
			label: '员工姓名',
			name : "splitEmployeeName",
			index : "splitEmployeeName",
			align : 'center',
			width : '100'
		}, {
			label: '当月此合同业绩',
			name : "splitmoney",
			index : "splitmoney",
			align : 'center',
			width : '100'
		}, {
			label: '分成比例',
			name : "splitpercent",
			index : "splitpercent",
			align : 'center',
			width : '100'
		}, {
			label: '合同个数',
			name : "everyoneNo",
			index : "everyoneNo",
			align : 'center',
			width : '100'
		}],
		rowNum: data.length,
		multiselect : false,
		gridComplete : function() {
			// 隐藏grid底部滚动条
			$(this).closest(".ui-jqgrid-bdiv").css({
				"overflow-x" : "hidden"
			});
			$(this).jqGrid("setGridWidth", vm.$el.offsetWidth * 1, true);
			$(this).jqGrid("setLabel", 'rn', '序号', {'text-align': 'center'});
		},
		rownumbers: true,
		rownumWidth: 40,
	});
}